/*
* @Author: wanghongfucoder
* @Date:   2017-02-21 09:06:14
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-02-21 09:11:55
*/

/**
 * 事件是由EventEmitter对象提供
 * 
 * @type {[type]}
 */
var EventEmitter=require('events').EventEmitter;
var event=new EventEmitter();
event.on('some_event', function() {
	console.log("some_event occured.");
	/* Act on the event */
});

setTimeout(function(){
	event.emit('some_event');
},1000);